{extend name="public/base" /}
{block name="title"}类目列表{/block}

{block name="content"}
<h2 class="sub-header">类目管理</h2>[ <a href="/fladmin/Category/add">增加类目</a> ]<br><br>

<form name="listarc"><div class="table-responsive">
<table class="table table-striped table-hover">
<thead><tr><th>ID</th><th>名称</th><th>操作</th></tr></thead>
<tbody id="cat-list">
<?php if($list){foreach($list as $row){ ?>
<tr id="cat-<?php echo $row["id"]; ?>">
<td><?php echo $row["id"]; ?></td>
<td><a href="/fladmin/Article?id=<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></a></td>
<td><a href="/fladmin/Category/add?parent_id=<?php echo $row["id"]; ?>">增加子类</a> | <a href="/fladmin/Category/edit?id=<?php echo $row["id"]; ?>">更改</a><?php if(!$row['sub']){ ?> | <a onclick="delconfirm('/fladmin/Category/del?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a><?php } ?></td>
</tr>
<?php if($row['sub']){foreach($row['sub'] as $k=>$v){ ?>
<tr id="cat-<?php echo $v["id"]; ?>">
<td><?php echo $v["id"]; ?></td>
<td><a href="/fladmin/Article?id=<?php echo $v["id"]; ?>">— <?php echo $v["name"]; ?></a></td>
<td><a href="/fladmin/Category/edit?id=<?php echo $v["id"]; ?>">更改</a> | <a onclick="delconfirm('/fladmin/Category/del?id=<?php echo $v["id"]; ?>')" href="javascript:;">删除</a></td>
</tr>
<?php }} ?>
<?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
{/block}